package org.xg.study.pd.test;

import org.junit.Test;
import org.xg.study.pd.CacheService;
import org.xg.study.pd.factory.JDKProxy;
import org.xg.study.pd.factory.impl.EGMCacheAdapter;
import org.xg.study.pd.factory.impl.IIRCacheAdapter;
import org.xg.study.pd.impl.CacheServiceImpl;

/**
 * @author CMG
 * @version 1.0
 * @cLassName ApiTest2_02
 * @description
 * @date 2021/9/9 13:54
 **/
public class ApiTest2_02 {
    @Test
    public void test_cacheService() throws Exception {
        CacheService proxy_egm = JDKProxy.getProxy(CacheServiceImpl.class, new EGMCacheAdapter());
        proxy_egm.set("user_name_01","xg");
        String value = proxy_egm.get("user_name_01");
        System.out.println(value);

        CacheService proxy_iir = JDKProxy.getProxy(CacheServiceImpl.class, new IIRCacheAdapter());
        proxy_iir.set("user_name_02","xg");
        String value1 = proxy_iir.get("user_name_02");
        System.out.println(value1);
    }
}
